feat: declare minimum compatible version for typing-extensions - #214
Merged
Conversation
Core's only runtime dependency was declared bare, so a bare install resolved at its floor gets typing-extensions 3.6.2 and cannot be imported at all. >=4.0 carries `Self`; 4.4 and 4.5 raise on import under Python >=3.12, so 4.6 is the lowest release that works across the supported interpreter range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #213.
Core's only runtime dependency was declared bare. A bare install resolved at its
floor gets
typing-extensions==3.6.2and does not import:ADR-0007
argues this dependency is load-bearing and names both uses; the floor those uses
imply was never written down.
typing-extensions>=4.6How the floor was established
Bare core (
uv pip install --no-deps .) plus one pinnedtyping-extensions,import lite_bootstrap, on every interpreter in the CI matrix:Two independent constraints, so the comment follows the
litestar>=2.15idiom ofnaming both and letting the higher one win:
AttributeError: module 'typing_extensions' has no attribute 'Self',raised while evaluating the return annotations on
BaseConfig.from_dictandfrom_object.TypeError: type 'typing.TypeVar' is not an acceptable base type, raised insidetyping_extensionsitself on Python >=3.12, which madetyping.TypeVarnon-subclassable. Neither release declares aRequires-Pythonceiling, so a resolver on 3.12+ will pick them under a
>=4.0floor. That iswhat rules out the simpler declaration.
After the change,
uv pip install --resolution lowest-direct .resolvestyping-extensions==4.6.0and imports clean on 3.10 through 3.14.The 3.14 column
3.10.0.2 passes on 3.14 alone because PEP 649 defers annotation evaluation there,
so the missing
Selfis never looked up at import. TheTypedDictbase class isstill evaluated eagerly and 3.10.0.2 provides it. The floor is set by the
interpreters where the annotation is evaluated, not by the one where it is not.
What this does not do
No test accompanies the declaration, matching #211: the claim is about resolution,
which nothing in the suite exercises.
just test-ci(277 passed, 100% coverage)and
just lint-cipass unchanged, anduv.lockis untouched because every extraalready pulls
typing-extensionsfar above 4.6 transitively. #210 is the job thatwould hold this floor; until it exists the declaration is verified by the table
above and nothing else.
Eleven bare requirements remain, tracked in #213.